package chapter21;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2019/2/25 15:34
 */
class Student3 {
    private String name;
    private int age;
    private double score;

    public Student3() {
    }

    public Student3(String name, int age, double score) {
        this.name = name;
        this.age = age;
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student3{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", score=" + score +
                '}';
    }
}

public class MapperTest {
    public static void main(String[] args) {
        ISimpleMapper mapper = new SimpleMapper();
        Student3 student3 = new Student3("小马", 12, 90.1);
        String s = mapper.toString(student3);
        System.out.println(s);

        Student3 student31 = (Student3) mapper.toObject(s);
        System.out.println(student31);
    }
}
